/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package jsalon.web.controller;

import static jamjun.infra.web.CHelper.MappingRequestToObj;
import jamjun.infra.web.Content;
import jamjun.infra.web.Controller;
import jamjun.infra.web.GSession;
import jamjun.infra.web.Json;
import jamjun.infra.web.Result;
import jamjun.infra.web.View;
import java.lang.annotation.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jsalon.web.vm.CustomerVM;
/**
 *
 * @author Java
 */
//@WebServlet(name = "test", urlPatterns = {"/mast/test"})
@WebServlet(name = "test", urlPatterns = {"/test"})
public class TestController extends Controller{
    public static Result index()
    {
        //String nickName = GSession.Request.getParameter("name");
        String nickName = "";
        CustomerVM viewModel = new CustomerVM();
        //viewModel.setMemberID("M001");
        //viewModel =(CustomerVM) MappingRequestToObj(viewModel,GSession.getRequest());
        return new View("/View/Mast/Test/index.jsp",viewModel);
    }
    
    public static Result content()
    {
        String name = GSession.Request.getParameter("name");
        return new Content("Test Hello Java");
    }
    
    public static Result json()
    {
        CustomerVM obj = new CustomerVM();
        //return new Json("{\"success\":\"true\"}");
        return new Json(obj);
    }
    
    public static Result testResource()
    {
        CustomerVM viewModel = new CustomerVM();
        //viewModel.setMemberID("M001");
        //viewModel =(CustomerVM) MappingRequestToObj(viewModel,GSession.getRequest());
        return new View("/View/Test/testResource.jsp",viewModel);
    }
}
